package ua.net.gm.server.walker.dummy;

import java.util.Map;
import java.util.TreeSet;
import ua.net.gm.server.walker.IWalker;
import ua.net.gm.server.walker.IWalkerMove;
import ua.net.gm.server.walker.IWalkerMovesEstimator;
import ua.net.gm.server.walker.IWalkerMovesFactory;
import ua.net.gm.server.walker.WalkerMoveRank;
import ua.net.gm.server.walker.WalkerStrategy;

/**
 *
 * @author Yason
 */
public class BestMoveStrategy extends WalkerStrategy
{
    public BestMoveStrategy(IWalkerMovesFactory factory, IWalkerMovesEstimator estimator)
    {
        super(factory, estimator);
    }

    @Override
    protected IWalkerMove chooseMove(IWalker state, Map<WalkerMoveRank, IWalkerMove> moves)
    {
        TreeSet<WalkerMoveRank> ranks = new TreeSet(moves.keySet());
        return moves.get(ranks.last());
    }
}
